package com.itheima.common;

import org.apache.logging.log4j.ThreadContext;
import org.springframework.stereotype.Component;

/**
 * @email 1572178030@qq.com
 * @author:黄海宾
 * @date: 2023/2/7  15:05
 */

public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }
}
